﻿var Clsid = "{C3EC3383-46B7-4A84-8552-3A29ADD0C44B}";
var ClassName = "gDNS.BTS_DNS";
var LibPath = System.Gadget.path + "\\gDNS.ocx";
var oShell = new ActiveXObject("WScript.Shell");
 
function RegisterLibrary()
{
  oShell.RegWrite("HKCU\\SOFTWARE\\Classes\\" + ClassName + "\\", ClassName, "REG_SZ");
  oShell.RegWrite("HKCU\\SOFTWARE\\Classes\\" + ClassName + "\\CLSID\\", Clsid, "REG_SZ");
  oShell.RegWrite("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\", ClassName, "REG_SZ");
  oShell.RegWrite("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\InprocServer32\\", LibPath, "REG_SZ");
  oShell.RegWrite("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\ProgID\\", ClassName, "REG_SZ");
}
 
function UnregisterLibrary()
{
  oShell.RegDelete("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\ProgID\\");
  oShell.RegDelete("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\InprocServer32\\");
  oShell.RegDelete("HKCU\\SOFTWARE\\Classes\\CLSID\\" + Clsid + "\\");
  oShell.RegDelete("HKCU\\SOFTWARE\\Classes\\" + ClassName + "\\CLSID\\");
  oShell.RegDelete("HKCU\\SOFTWARE\\Classes\\" + ClassName + "\\");
}
 
RegisterLibrary();
window.attachEvent("onunload", UnregisterLibrary);